﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

[CustomPropertyDrawer(typeof(RenameAttribute))]
public class RenameDrawer : PropertyDrawer
{
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        //替换属性名称
        RenameAttribute rename = (RenameAttribute)attribute;
        label.text = rename.name;
        //重绘GUI
        EditorGUI.PropertyField(position, property, label);
    }
}
